<template>
  <el-container class="topPanel" v-show="isTopVisible">
      <div :style="{backgroundImage:'url(' + top1Image + ')'}" class="top-image top-image-1" style="display: inline-block;">
          <h1 class="top-title">滨海新区轨道交通BIM技术应用平台</h1>
          <div class="top-image top-image-3" :style="{backgroundImage:'url(' + top3Image + ')'}"></div>
      </div>
      <div style="display: inline-block;width: calc(100% - 490px);">
          <div :style="{backgroundImage:'url(' + top2Image + ')'}" class="top-image top-image-2">
              <span class="top-time">{{timeValue}}</span>
          </div>
          <div class="top-panel-4">
              <div class="top-panel-4-tool">
              </div>
          </div>
      </div>
  </el-container>
</template>

<script>
import {
    mapState
} from 'vuex'
import moment from 'moment'
import top1Image from '@/assets/top-1.png'
import top2Image from '@/assets/top-2.png'
import top3Image from '@/assets/top-3.png'
export default {
    name: 'TheTopPanel',
    components: {},
    data() {
        return {
            top1Image,
            top2Image,
            top3Image,
            pictureHeight: 95,
            opacityValue: Config.mainOpacityValue,
            timeValue: ''
        }
    },
    computed: {
        ...mapState(['isTopVisible'])
    },
    mounted() {
        moment.locale('zh-cn');
        let timer = null,
            me = this,
            setTimeValue = () => {
                clearTimeout(timer);
                me.timeValue = moment().format('YYYY年MM月DD日, hh:mm:ss a');
                timer = setTimeout(setTimeValue, 1000);
            }
        setTimeValue();
    }
}
</script>

<style lang="less" scoped>
//@import "../assets/var.less";
.topPanel {
    position: fixed;
    display: inline-block;
    width: 100%;
    z-index: 100;
    left: 0px;
    top: 0px;
    height: 70px;
}

.headPanel,
.top-image {
    &:extend(.wxm-bg-image);
}

.top-image-1 {
    height: 70px;
    width: 488px;
    background-color: #021f47;
}

.top-image-2 {
    height: 29px;
    width: 100%;
}

.top-image-3 {
    position: absolute;
    bottom: 10px;
    left: 40px;
    height: 16px;
    width: 369px;
}

.top-panel-4 {
    height: 41px;
    width: 100%;
    background-color: #021f47;

    .top-panel-4-tool {
        margin-left: -50px;
    }

    & /deep/ .toolbar {
        width: calc(100% - 430px);
    }
}

.top-title {
    position: absolute;
    width: 390px;
    height: 50px;
    font-size: 24px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    font-style: italic;
    color: #FFFFFF;
    line-height: 34px;
    margin-top: 10px;
    margin-left: 20px;
}

.top-time {
    position: absolute;
    margin-top: 10px;
    right: 10px;
    overflow-wrap: break-word;
    color: rgba(255, 255, 255, 1);
    font-size: 12px;
    white-space: nowrap;
    line-height: 12px;
    display: block;
}
</style>
